include_directories(
	${CMAKE_CURRENT_SOURCE_DIR}
	${CMAKE_CURRENT_BINARY_DIR}
	${CMAKE_CURRENT_SOURCE_DIR}/../mitab/cpl
	${CMAKE_CURRENT_SOURCE_DIR}/../mitab/mitab
	${CMAKE_CURRENT_SOURCE_DIR}/../mitab/ogr
	${UNMANAGED_INCLUDE_DIR}
	${UNMANAGED_INCLUDE_DIR}/Fdo/Expression
	${UTILITIES_COMMON_INCLUDE_DIR}
	${UTILITIES_EXPRESSION_INCLUDE_DIR}
	)

set( MapInfoProvider_SRCS
   MapInfo.cpp
   MapInfoApplySchema.cpp
   MapInfoClassDefinition.cpp
   MapInfoCommandCapabilities.cpp
   MapInfoConnection.cpp
   MapInfoConnectionCapabilities.cpp
   MapInfoConnectionInfo.cpp
   MapInfoCSOverrideFile.cpp
   MapInfoCreateSpatialContext.cpp
   MapInfoDescribeSchema.cpp
   MapInfoExpressionCapabilities.cpp
   MapInfoFeatureReader.cpp
   MapInfoFeatureSchema.cpp
   MapInfoFilterCapabilities.cpp
   MapInfoGeometryCapabilities.cpp
   MapInfoGetSpatialContexts.cpp
   MapInfoOptimizedAggregateReader.cpp
   MapInfoQueryOptimizer.cpp
   MapInfoRasterCapabilities.cpp
   MapInfoSchemaCapabilities.cpp
   MapInfoSelect.cpp
   MapInfoSelectAggregates.cpp
   MapInfoSelectAggregatesCommand.cpp
   MapInfoSpatialContext.cpp
   MapInfoSpatialContextReader.cpp
   MapInfoTopologyCapabilities.cpp
   OgrFdoUtil.cpp
)

add_library( MapInfoProvider SHARED ${MapInfoProvider_SRCS} )

target_link_libraries( MapInfoProvider
	FDO
	ProvidersCommon
	ExpressionEngine
 )

if( CMAKE_COMPILER_IS_GNUCXX )
	target_link_libraries( MapInfoProvider
		-Wl,-whole-archive
		mitab
		-Wl,-no-whole-archive
		)
else( CMAKE_COMPILER_IS_GNUCXX )
	target_link_libraries( MapInfoProvider
		mitab
		)
endif( CMAKE_COMPILER_IS_GNUCXX )

	
add_dependencies( MapInfoProvider MapInfoMessage )

set_target_properties( MapInfoProvider PROPERTIES VERSION ${FDO_VERSION} SOVERSION ${FDO_VERSION_MAJOR} )

install( TARGETS MapInfoProvider DESTINATION ${LIB_INSTALL_DIR} )

